﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace RoutingAlgorithms
{
    class Path
    {
        public List<Link> links;

        // public List<Link> Links { get { return this.links; } }

        // Max usable bandwidth m_bw
        // Ex: n(A) --4-> n(B) --3->  n(C) --2-> n(D) --3-> n(E)
        //     usable bandwidth of this path must be 2 (m_bw = 2)
        public double m_bw;

        // Cost for this path
        public double cost;

        // Numbers of Hop (or node) in this path
        public int NumsNode
        {
            get
            {
                return this.links.Count;
            }
        }

        public List<Link> Links
        {
            get { return this.links; }
            set { this.links = value; }
        }

        // CONTRUCTOR
        public Path()
        {
            this.links = new List<Link>();
            this.m_bw = 0;
            this.cost = 0;
        }

        public Path(Path path)
        {
            this.links = path.links;
            this.m_bw = path.m_bw;
            this.cost = path.cost;
        }

        public void Print()
        {
            if (links.Count > 0)
            {
                Console.Write("{0} ", links[0].Source.Id);

                foreach (Link link in links)
                {
                    Console.Write("-> {0}", link.Destination.Id);
                }
            }
        }

    }
}
